import {post,get,del} from '@/utils/http'
import type {ILoginFormType,ILoignResultType} from '@/typings/userType'
import type {IHospitalResult,IAddCourtyardType} from '@/typings/HospitalType'

//医院导航的列表
export const getHospitalUserApi=(currentPage=1,pageSize=10)=>
get<IHospitalResult>(`/api/hospital/yrdh?currentPage=${currentPage}&pageSize=${pageSize}`)

// 删除指定id的信息
export const deleteIdToUserApi = (id:number) => del(`/api/hospital/yrdh/${id}`)

// 选中删除用户,它会有多个id记录,通过请求体传过去
export const deleteAllUserApi = (ids:number[]) => post(`/api/hospital/yrdh/deleteall`, { ids })

// 批量添加用户数据
export const batchAddUserApi = (users:any[]) => post(`/api/hospital/yrdh/batchAddUser`, { users })

// 根据id返回对应用户信息
export const getUseridToInfoApi = (id:number) => get(`/api/hospital/yrdh/${id}`)

// 根据用户id来修改对应用户记录
export const getUserEditToInfoApi = (id:number) => get(`/api/hospital/yrdh/edit/${id}`)

//添加庭院
export const AddCourtyardApi = (formData: IAddCourtyardType) =>
  post<IAddCourtyardType>(`/api/yrdh/Counrtyard`, formData)

  //修改庭院
  export const EditCourtyardApi= (formData: IAddCourtyardType,id:number) =>
  post<IAddCourtyardType>(`/api/yrdh/Counrtyard/${id}`, formData,id)

  //根据庭院id，获取庭院信息
  export const getCourtyardIdToInfoApi= (id:number) =>
  get<IAddCourtyardType>(`/api/yrdh/Counrtyard/${id}`)
